#include <iostream>
#include <string>

int main() {
    std::string a;
    std::cin >> a;

    int i = 0;
    while (i < a.length()) {
        if (a[i] == '(') {
            if (a[i+1] == ')' || a[i+2] == ')') {
                std::cout << "true" << std::endl;
                break;
            } else {
                std::cout << "false" << std::endl;
                break;
            }
        } else if (a[i] == '[') {
            if (a[i+1] == ']' || a[i+2] == ']') {
                std::cout << "true" << std::endl;
                break;
            } else {
                std::cout << "false" << std::endl;
                break;
            }
        } else if (a[i] == '{') {
            if (a[i+1] == '}' || a[i+2] == '}') {
                std::cout << "true" << std::endl;
                break;
            } else {
                std::cout << "false" << std::endl;
                break;
            }
        } else if (a[i] == '<') {
            if (a[i+1] == '>' || a[i+2] == '>') {
                std::cout << "true" << std::endl;
                break;
            } else {
                std::cout << "false" << std::endl;
                break;
            }
        } else if (a[i] == ' ') {
            if (a[i+1] == ' ' || a[i+2] == ' ') {
                std::cout << "true" << std::endl;
                break;
            } else {
                std::cout << "false" << std::endl;
                break;
            }
        } else {
            std::cout << "false" << std::endl;
            break;
        }
        i++;
    }

    return 0;
}